//package test;
//
//import base.Intake;
//import com.sun.lwuit.Container;
//import com.sun.lwuit.Label;
//import db.IntakeManager;
//import java.util.Date;
//import java.util.Vector;
//import javax.microedition.midlet.MIDlet;
//
///**
// *
// * @author Shayan
// */
//public class IntakeTestForm extends TestForm {
//
//    public IntakeTestForm(final MIDlet parent) {
//        super(parent);
//        setTitle("Intake tests");
//    }
//
//    protected TestForm getNextForm(MIDlet parent) {
//        return null;
//    }
//
//    protected void runTests(Container mainContainer) throws Exception {
//
//        String shayanId = "E506CFA4-0235-11DF-8095-6B2556D89593";
//        String otherId = "5E074AF4-0237-11DF-A07E-CA2D56D89593";
//
//        Intake i1 = new Intake(shayanId, "EAD2EF12-0235-11DF-88CD-872556D89593", 10.0f, "G", new Date(100L));
//        Intake i2 = new Intake(shayanId, "EAD2EF12-0235-11DF-88CD-872556D89594", 20.0f, "H", new Date(110L));
//        Intake i3 = new Intake(shayanId, "EAD2EF12-0235-11DF-88CD-872556D89593", 30.0f, "I", new Date(120L));
//
//        Intake i4 = new Intake(otherId, "EAD2EF12-0235-11DF-88CD-872556D89593", 10.0f, "G", new Date(100L));
//        Intake i5 = new Intake(otherId, "EAD2EF12-0235-11DF-88CD-872556D89593", 10.0f, "G", new Date(110L));
//        Intake i6 = new Intake(otherId, "EAD2EF12-0235-11DF-88CD-872556D89593", 10.0f, "G", new Date(120L));
//
//        IntakeManager.persist(i1);
//        IntakeManager.persist(i2);
//        IntakeManager.persist(i3);
//
//        IntakeManager.persist(i4);
//        IntakeManager.persist(i5);
//        IntakeManager.persist(i6);
//
//        mainContainer.addComponent(new Label("Shayan intakes:"));
//        Vector shayans = IntakeManager.getIntakes(shayanId, new Date(1L), new Date(115L));
//        mainContainer.addComponent(new Label("#:" + shayans.size()));
//
//        mainContainer.addComponent(new Label("Other intakes:"));
//        Vector others = IntakeManager.getIntakes(otherId, new Date(1L), new Date(215L));
//        mainContainer.addComponent(new Label("#:" + others.size()));
//
//        mainContainer.addComponent(new Label("i ----"));
//
//        Intake intake = (Intake) shayans.elementAt(1);
//        mainContainer.addComponent(new Label("foodId:" + (intake.getFoodId().equalsIgnoreCase("EAD2EF12-0235-11DF-88CD-872556D89594"))));
//        mainContainer.addComponent(new Label("unit:" + (intake.getUnit().equals("H"))));
//        mainContainer.addComponent(new Label("qty:" + (intake.getQuantity() == 20.0f)));
//        mainContainer.addComponent(new Label("date:" + (intake.getDate().getTime() == 110L)));
//
//        mainContainer.addComponent(new Label("order ----"));
//        for (int index = 0; index < shayans.size(); index++) {
//            mainContainer.addComponent(new Label("date[" + index + "]=" + ((Intake) shayans.elementAt(index)).getDate().getTime()));
//        }
//
//    }
//}
